package com.zara.store.client.model;

import java.util.Collection;
import java.util.List;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.zara.store.common.EnvtVO;
import com.zara.store.common.InvoiceVO;
import com.zara.store.common.OfadVO;
import com.zara.store.common.PalcItemVO;
import com.zara.store.common.PalcItemViewVO;
import com.zara.store.common.PalcVO;
import com.zara.store.common.ProductVO;
import com.zara.store.server.StoreFacade;

public class StoreProxy {
	
	private StoreFacade storeFacade;
	private String naming = "zara.store/StoreFacadeBean/remote";

	public StoreProxy() throws NamingException {
		InitialContext ic = new InitialContext();
		storeFacade = (StoreFacade) ic.lookup(naming);
	}
	
	public ProductVO queryProduct(String barcode) {
		return storeFacade.queryProduct(barcode);
	}
	
	public InvoiceVO createInvoice(InvoiceVO invoice) {
		return storeFacade.createInvoice(invoice);
	}

	public Collection<PalcItemViewVO> queryPalcProductList() {
		return storeFacade.queryPalcProductList();
	}

	public PalcVO createPalc(List<PalcItemVO> order) {
		return storeFacade.createPalc(order);
	}

	public OfadVO createOfad(OfadVO ofadVO) {
		return storeFacade.createOfad(ofadVO);
	}

	public EnvtVO createEnvt(EnvtVO envtVO) {
		return storeFacade.createEnvt(envtVO);
	}

}
